import React from 'react'

import store from '../../store/store'
import { getMovieListAction } from '../../store/actions/movie_action'

export default function Movie() {

  const { count } = store.getState().countReducer
  const { movieList } = store.getState().movieReducer

  const queryMoveList = () => {
    store.dispatch(getMovieListAction())
  }

  return (
    <div>
      <h2>Movie</h2>
      <div>
        <p>count: {count}</p>
        <button onClick={queryMoveList}>查询 movie</button>
        <hr />
        <ul>
          {
            movieList.map(item => {
              const { albumId, albumName } = item
              return (
                <li key={albumId}>{albumName}</li>
              )
            })
          }
        </ul>
      </div>
    </div>
  )
}
